#pragma once

#include "cocos2d.h"
#include <cstdlib>
#include "SimpleAudioEngine.h"

#include "AtlasLoader.h"
#include "GameScene.h"
#include "GameLayer.h"
#include "Number.h"

using namespace std;
using namespace cocos2d;
using namespace CocosDenshion;

const string NUMBER_SCORE = "number_score";
const string NUMBER_FONT = "font";
const int CURRENT_SCORE_SPRITE_TAG = 10001;

class StatusLayer : public Layer, public StatusDelegate {
public:
	StatusLayer();

	~StatusLayer();

	virtual bool init();

	CREATE_FUNC(StatusLayer);

	void onGameStart(void);

	void onGamePlaying(int score);

	void onGameEnd(int curScore, int bestScore);

private:
	void showReadyStatus();

	void showStartStatus();

	void loadWhiteSprite();

	void blinkFullScreen();

	void fadeInGameOver();

	void jumpToScorePanel();

	void setBlinkSprite();

	void fadeInRestartBtn();

	void menuRestartCallback(Object *pSender);

	void refreshScoreCallback();

	void refreshScoreExecutor(float dt);

	void blinkAction();

	string getMedalsName(int score);

	void showOverStatus(int curScore, int bestScore);

	Sprite *blink;
	Sprite *whiteSprite;
	Sprite *scoreSprite;
	Sprite *getreadySprite;
	Sprite *tutorialSprite;

	int currentScore;
	int bestScore;
	int tmpScore;
	bool isNewRecord;
	Point originPoint;
	Size visibleSize;
};

